package SearchDB
import org.hibernate.Session

/**
 * Class that manages the database
 * @param session the SQL session
 */
class TagManager (session: Session) {
  if (session == null) {
    throw new RuntimeException("Invalid session object")
  }

  /**
   * Method to save a tuple in the database
   * @param tag the tag to save
   */
  def saveFile(tag:Tag) {
    session.save(tag)
  }

  /**
   * Method to delete a tuple from the database
   * @param tag the tag to delete
   */
  def deleteFile(tag: Tag) {
    session.delete(tag)
  }

}